package com.example.r2022913.service.WxService.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.r2022913.model.dao.WxDao.MessageDao;
import com.example.r2022913.model.entity.WxEntity.MessageEntity;
import com.example.r2022913.service.WxService.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    MessageDao messageMapper;
    @Override
    @Cacheable(value = "messageList")
    public IPage studentIpage(Integer pages, Integer rows) {
        Page<MessageEntity> messageEntityPage =new Page<>(pages,rows);
        QueryWrapper<MessageEntity> queryWrapper = new QueryWrapper<>();
        IPage<MessageEntity> iPage = messageMapper.selectPage(messageEntityPage,queryWrapper);
        return iPage;
    }
}
